package com.zzyl.nursing.controller.member;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.zzyl.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zzyl.common.annotation.Log;
import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.enums.BusinessType;
import com.zzyl.nursing.domain.MemberOrders;
import com.zzyl.nursing.service.IMemberOrdersService;
import com.zzyl.common.utils.poi.ExcelUtil;
import com.zzyl.common.core.page.TableDataInfo;

/**
 * 服务下单Controller
 * 
 * @author liushaoxu
 * @date 2025-06-16
 */
@Api(tags = "服务下单管理")
@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController
{
    @Autowired
    private IMemberOrdersService memberOrdersService;

    /**
     * 查询服务下单列表
     */
    @ApiOperation("查询服务下单列表")
//    @PreAuthorize("@ss.hasPermi('member:orders:list')")
    @GetMapping("/project/page")
    public TableDataInfo<List<MemberOrders>> list(@ApiParam("服务下单查询条件") MemberOrders memberOrders)
    {
        startPage();
        List<MemberOrders> list = memberOrdersService.selectMemberOrdersList(memberOrders);
        return getDataTable(list);
    }


    /**
     * 1.2 根据编号查询护理项目信息
     */
    @ApiOperation("获取服务下单详细信息")
//    @PreAuthorize("@ss.hasPermi('member:orders:query')")
    @GetMapping(value = "/project/{id}")
    public R<MemberOrders> getInfo(@ApiParam("服务下单ID") @PathVariable("id") Long id)
    {
        return R.ok(memberOrdersService.selectMemberOrdersById(id));
    }


}
